﻿//Dùng tại frmTruyenThong.sbtnIn()

using System;
using System.Data;
using System.Data.SqlClient;
using DevExpress.XtraReports.UI;
using DevExpress.XtraEditors;
using prjKQXS_DLL;
using prjKQXS_DLL.Dal;

namespace prjKQXS_Report.Ve_so
{
    public partial class rptBangNhanVe : XtraReport
    {
        public DataTable dtSource;

        public rptBangNhanVe()
        {
            InitializeComponent();
        }

        private void rptBangNhanVe_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            xrlblNgay.Text += ((DateTime)pTuNgay.Value).ToString("dd/MM/yyyy");
            xrlblDonVi.Text = "PHÒNG XSKT " + pTenDV.Value.ToString().Trim().ToUpper();
            xrlblNguoiQuanLy.Text += pTenCB.Value.ToString().Trim();

            dsReports dsReports1 = new dsReports();
            Report_DAL report_dal = new Report_DAL();
            dsReports1 = report_dal.reportDungChung(dsReports1);
            dsReports1.Tables.Remove("rptTruyenThong");
            dsReports1.Tables.Add(dtSource);
            this.DataSource = dsReports1;
            this.DataMember = "rptTruyenThong";
        }
    }
}
